package borge.web.teamspirit.client.panels;

import java.util.Date;

import borge.web.teamspirit.client.data.News;
import borge.web.teamspirit.client.data.Person;
import borge.web.teamspirit.client.interfaces.WidgetEventHandler;
import borge.web.teamspirit.client.widgets.ShowNewsWidget;

import com.google.gwt.user.client.ui.Label;

public class WelcomePanel extends MiddlePanel implements WidgetEventHandler {
	
	private String welcomeText = "This is a welcome text. " +
			"This is a welcome text. " +
			"This is a welcome text. " +
			"This is a welcome text. ";
		
	
	private Label welcomeLabel;
	private ShowNewsWidget iNewsWidget;
	
	public WelcomePanel(){
		
		welcomeLabel = new Label(welcomeText);
		// we should have events, news, some text
		// perhaps events on the side actually..?
		
		add(welcomeLabel);
		
		News news = new News();
		news.setTitle("Testing the news listing");
		news.setDate(new Date());
		String newsText = welcomeText.replace("welcome", "news");
		news.setText(newsText);
		Person p = new Person();
		p.setFirstName("Andreas");
		p.setLastName("Borglin");
		//news.setPoster(p);
		iNewsWidget = new ShowNewsWidget(null, news, 0);
		
		add(iNewsWidget);
	}

	@Override
	public void handleWidgetEvent(WidgetEventType aEvent) {
		// TODO Auto-generated method stub
		
	}

}
